<template>
  <div>
    <div>
      <ul>
        <li>
          <router-link to="/contacts/all_contacts">All_contacts</router-link>
        </li>
        <li><router-link to="/contacts/alice">Contacts</router-link></li>
        <li><router-link to="/contacts/bob">Bob</router-link></li>
      </ul>
      <button @click="btn">随机显示</button>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["/contacts/all_contacts", "/contacts/alice", "/contacts/bob"],
    };
  },
  methods: {
    btn() {
      this.$router.push({
        path: this.arr[Math.floor(Math.random() * this.arr.length)],
      });
    },
  },
};
</script>

<style>
</style>